{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%run -n main.py\n",
    "!mkdir -p {DATA_DIR}\n",
    "\n",
    "s3 = S3()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# merge"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%run -n main.py\n",
    "if not exists(LENTA):\n",
    "    s3.download(S3_LENTA, LENTA)\n",
    "    s3.download(S3_NER, NER)\n",
    "    s3.download(S3_MORPH, MORPH)\n",
    "    s3.download(S3_SYNTAX, SYNTAX)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# %run -n main.py\n",
    "# lenta = load_lenta(LENTA)\n",
    "# lenta = log_progress(lenta, desc=LENTA, total=LENTA_TOTAL)\n",
    "\n",
    "# lines = load_gz_lines(NER)\n",
    "# items = parse_jl(lines)\n",
    "# ner = (parse_ner_markup(_) for _ in items)\n",
    "\n",
    "# lines = load_gz_lines(MORPH)\n",
    "# items = parse_jl(lines)\n",
    "# morph = (parse_morph_markup(_) for _ in items)\n",
    "\n",
    "# lines = load_gz_lines(SYNTAX)\n",
    "# items = parse_jl(lines)\n",
    "# syntax = (parse_syntax_markup(_) for _ in items)\n",
    "\n",
    "# records = merge(lenta, ner, morph, syntax)\n",
    "# lines = format_merge_conll(records)\n",
    "# dump_gz_lines(lines, NERUS)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# s3.upload(NERUS, S3_NERUS)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
